<%@ page import="java.util.ArrayList" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2015/10/11
  Time: 22:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
  <form action="/AnsibleTest" method="post">
    主机选择：<select name="myhost">
    <option value="me">me</option>
  </select><br />
    模板选择：<select name="mymodule">
    <option value="shell">shell</option>
    <option value="raw">raw</option>
  </select><br />
    输入命令：<input type="text" name="mycommand" /><br />
    <input type="submit" value="提交" />
  </form>
  <%
    String ansiblecommand = (String)request.getAttribute("ansiblecommand");
    if (ansiblecommand != null && !"".equals(ansiblecommand)){
      %>
  运行的命令是：<%=(String)request.getAttribute("ansiblecommand")%><br />
  <%
    }
  %>

  <%
    ArrayList<String> processList = (ArrayList)request.getAttribute("processList");
    if(processList != null){
      %>
  命令输出是：<br />
  <%
      for (String line: processList){
        %>
        <%=line%><br>
    <%
      }
    }
  %>
</body>
</html>
